/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package bullsandcows;

import Game.bc.BullCow;
import Game.bc.GameLogicRemote;
//import Game.bc.TestRemote;
import bullsandcows.serviceclient.GetWordServiceService;
import java.util.ArrayList;
import javax.ejb.EJB;
import javax.xml.ws.WebServiceRef;

/**
 *
 * @author huizi.you
 */
public class Main {
    @WebServiceRef(wsdlLocation = "META-INF/wsdl/localhost_8080/GetWordServiceService/GetWordService.wsdl")
    private static GetWordServiceService service;
  /* @EJB
    private static SinglePlayerRemote singlePlayer;*/
    @EJB
    private static GameLogicRemote test2;
   // @EJB
   // private static SingleGameRemote singleGame;
  
    
  
  
    /**
     * @param args the command line arguments
     */

    public static void main(String[] args) {

       new Main().start();
   //   makeGuess("love").printString();
       //singleGame.makeGuess("love").printString();
      /*  singleGame.makeGuess("crap").printString();
         singleGame.makeGuess("hole").printString();
          singleGame.makeGuess("pole").printString();
           singleGame.makeGuess("damn").printString();
            singleGame.makeGuess("word").printString();*/
       //test2.init(4);
       System.out.println(test2.getTheWord());
       test2.makeGuess("word", null).printString();
       test2.makeGuess("wosd", null).printString();
       test2.makeGuess("wosdjk", null).printString();
       test2.makeGuess("word", null).printString();
       test2.makeGuess("wosd", null).printString();
       test2.makeGuess("wosdjk", null).printString();

       try { // Call Web Service Operation
           bullsandcows.serviceclient.GetWordService port = service.getGetWordServicePort();
           // TODO initialize WS operation arguments here
           int wordLength = 5;
           // TODO process result here
           java.lang.String result = port.getWord(wordLength);
           System.out.println("Result = "+result);
       } catch (Exception ex) {
           // TODO handle custom exceptions here
       }

  /*   System.out.println(test2.call(3));
        System.out.println(test2.call(3));
         System.out.println(test2.call(4));
          System.out.println(test2.call(4));
           System.out.println(test2.call(5));
            System.out.println(test2.call(5));
             System.out.println(test2.call(6));
              System.out.println(test2.call(6));
               System.out.println(test2.call(7));
                System.out.println(test2.call(7));
                 System.out.println(test2.call(8));*/
    }

    private void start() {
      // singlePlayer.init(7);
       // singlePlayer.makeGuess("woll").printString();
     /*  makeGuess("worp").printString();
        makeGuess("cosw").printString();
        makeGuess("kkkk").printString();
        makeGuess("word").printString();*/
    }


}
